From: Brion Vibber Date: Wed, 7 Jan 2009 02:31:30 +0000 (+0000) Subject: Revert r45387 "Add special case handling of the XHTML character entity "'" to... X-Git-Tag: 1.31.0-rc.0~43535 X-Git-Url: http://git.cyclocoop.org/%22.%24info%5B?a=commitdiff_plain;h=705c175b55df44d108c4c4e1cecd1d8a13663525;p=lhc%2Fweb%2Fwiklou.git Revert r45387 "Add special case handling of the XHTML character entity "'" to normalizeEntity() and decodeEntity(). This should resolve the remainder of bug 14365. It might seem cleaner to just add the appropriate entry to $wgHtmlEntityAliases, but this would break decodeEntity() as currently written. Explicitly note this in the comments." This doesn't make any sense. Is there any reason not to just add apos to $wgHtmlEntities if it's valid XHTML? --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 1ea5d5d5cd..3461b79d31 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -470,8 +470,6 @@ The following extensions are migrated into MediaWiki 1.14: local URLs * (bug 16376) Mention in deleteBatch.php and moveBatch.php maintenance scripts that STDIN can be used for page list -* Sanitizer::decodeCharReferences() now decodes the XHTML "'" character - entity (loosely related to bug 14365) * (bug 16560) Special:Random returns a page from ContentNamespaces, and no longer from NS_MAIN diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php index a433ce0029..5d58b03655 100644 --- a/includes/Sanitizer.php +++ b/includes/Sanitizer.php @@ -59,9 +59,6 @@ define( 'MW_ATTRIBS_REGEX', /** * List of all named character entities defined in HTML 4.01 * http://www.w3.org/TR/html4/sgml/entities.html - * This list does *not* include ', which is part of XHTML - * 1.0 but not HTML 4.01. It is handled as a special case in - * the code. * @private */ global $wgHtmlEntities; @@ -321,7 +318,6 @@ $wgHtmlEntities = array( /** * Character entity aliases accepted by MediaWiki - * XXX: decodeEntity() assumes that all values in this array are valid keys to $wgHtmlEntities */ global $wgHtmlEntityAliases; $wgHtmlEntityAliases = array( @@ -951,7 +947,7 @@ class Sanitizer { * encoded text for an attribute value. * * See http://www.w3.org/TR/REC-xml/#AVNormalize for background, - * but note that we are not returning the value, but are returning + * but note that we're not returning the value, but are returning * XML source fragments that will be slapped into output. * * @param string $text @@ -1029,8 +1025,6 @@ class Sanitizer { return "&{$wgHtmlEntityAliases[$name]};"; } elseif( isset( $wgHtmlEntities[$name] ) ) { return "&$name;"; - } elseif( $name == 'apos' ) { - return "'"; // "'" is valid in XHTML, but not in HTML4 } else { return "&$name;"; } @@ -1132,8 +1126,6 @@ class Sanitizer { } if( isset( $wgHtmlEntities[$name] ) ) { return codepointToUtf8( $wgHtmlEntities[$name] ); - } elseif( $name == 'apos' ) { - return "'"; // "'" is not in $wgHtmlEntities, but it's still valid XHTML } else { return "&$name;"; }